var t = getApp(), e = t.requirejs('core');
Page({
    data: {
        list: [],
        page: 1,
        isEnd: false,
        total: 0
    },
    onLoad(e) {
        console.log(e);
        this.get_list(),
        wx.setNavigationBarTitle({
            title: '核销奖励'
        })
    },
    get_list() {
        if (this.data.isEnd) return
        e.get("member/hxawards/get_list", {page: this.data.page}, res => {
            let list = [];
            this.data.page != 1 && (list = this.data.list)
            res.list.length && res.list.forEach(item => {
                list.push(item)
            })
            this.setData({
                list,
                total:res.total
            })
            if(res.total==list.length){
                this.setData({
                    isEnd: true
                })
            }
            
        })
    },
    onReachBottom() {
        !this.data.isEnd && this.setData({
            page: this.data.page + 1
        }), this.get_list()
    }
})